home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
sw_42a.zip
/
SW42DEMO.BAT
< prev
Wrap
DOS Batch File
|
1992-02-29
|
7KB
|
294 lines
@ECHO OFF
rem A pre-SW screen just for effect
rem make sure the screen is default white on black
rem reset border
sw /o
rem save existing prompt
set sav=%prompt%
rem make sure there was room in environment
if "%sav%"=="" goto skip
set prompt=$e[0m$p$g
@echo on
cls
@echo off
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo Are Your Batch Files Dull?
echo.
echo Lifeless?
echo.
echo Boring?
echo.
echo SW.EXE is the answer!
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
pause
set prompt=%sav%
set sav=
:skip
rem skip over screen definitions
rem Put screen definitions at the beginning of the file for fastest execution
goto begin
rem Screen definition with default label
rem Windows are drawn in the order defined. Pause, Query and User Input will
rem occur as they are encountered. SW will return only the last Query result.
:Display
_window /kcya┼ /r2 /s /bred /w /0 /z
SW.EXE - Expanded Text Handling!
/tWHI+ Multiple Windows!
/m v 4.2
_window /r10 /s /bwhi /gblu /l1 /fred /0
/tBLU Optional Command Line Syntax:
SW @filename [label]
_window /r16 /s /bwhi /gblu /l1 /fred /0
/tBLU SW 4.x ADDITIONAL FEATURES
/tred /─
/jl "- Define the entire screen with multiple windows "
using external text files.
_window /r25 /l0 /0 /p100- /d
" - Press any key for more - "
_window /r19 /bwhi /gblu /l0 /jl /0 /p100-
"- Using labels, more than one definition can be "
included in the same file.
_window /r19 /bwhi /gblu /l0 /jl /0 /p100-
"- The screen definition can be included inside the"
calling batch file!
_window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a2
"- ~N~E~W~! SW can now evaluate Environment Variables "
included inside screen definitions.
_window /r25 /l0 /0 /p200- /d
" - Press any key to continue - "
:end_display
rem screen definition showing a menu with user defined label
:Snd_menu
_window /kcya▐▄▀▄▀▄▀▌ /kCYA /r3 /s /bred /w /0 /z
SW.EXE - New Sounds!
/m " v 4.2 "
_window /eRED /r11 /s /l1 /w
/mc ┤ Play a Sound ├
"~Low Tone ~Mid Tone ~High Tone"
"Bweep ~1 Bweep ~2 ~Bomb "
"~Siren ~Phasor ~Tweeter "
/tYEL /─
Close ~Encounters ~Charge
~WZLX
/m < ~E~S~C >
:end_Snd_menu
rem screen definition showing a menu with another user defined label
:4.2
_window /kwhi░▒▓ /r4 /bred /w /0 /o /z
SW.EXE - Bye, Bye ECHO!
/m v 4.2
_window /tRED /r11 /fWHI
They can also be placed anywhere on the screen they'll fit!
_window /c1 /r1 /tCYA /fBLU /bcya /l1 /0 /s1
Upper Left
_window /c71 /r1 /tMAG /fGRE /bmag /l1 /0 /s2
Upper Right
_window /c71 /r23 /tblu /fBLA /bgre /l1 /0 /s4
Lower Right
_window /c1 /r23 /tcya /fMAG /byel /l1 /0 /s3
Lower Left
_window /r18 /fWHI /tYEL+ /b4 /l5
(c) 1992 Warren Small
_window /r25 /l0 /0 /p100-
" - Pausing 10 seconds - "
_window /r25 /l0 /0 /p2
" - or less! - "
:end_4.2
:Charge
_window /aC4,2
_window /aF4,2
_window /aA4,2
_window /aC5,4
_window /aA4,2
_window /aC5,5
:End_Charge
:Close
_window /aA4,3
_window /aB4,3
_window /aG4,3
_window /aG3,3
_window /aD4,10
:End_Close
:WZLX
_window /aE5
_window /aG5
_window /aB5
_window /aE6
_window /aB5
_window /aG5
_window /aE5
:End_WZLX
rem labels for Alert sounds demos near the beginning of file
rem for faster execution
:beep1
sw /a1
goto BeepDemo
:beep2
sw /a2
goto BeepDemo
:beep3
sw /a3
goto BeepDemo
:beep4
sw /a4
goto BeepDemo
:beep5
sw /a5
goto BeepDemo
:beep6
sw /a6
goto BeepDemo
:beep7
sw /a7
goto BeepDemo
:beep8
sw /a8
goto BeepDemo
:beep9
sw /a9
goto beepdemo
:beep10
sw @sw42demo.bat charge
goto beepdemo
:beep11
sw @sw42demo.bat close
goto beepdemo
:beep12
sw @sw42demo.bat WZLX
goto beepdemo
rem Alternate errorlevel check using FOR loop
:beepdemo
sw /q^~lmh12bsptcew
for %%e in (1 2 3 4 5 6 7 8 9 10 11 12) do if errorlevel %%e goto beep%%e
if errorlevel 0 goto DI
rem Command line examples, positioning, colors, shadows, pause, Wide edge
rem Color numbers are used to shorten the line
rem Command line cannot exceed 128 characters
:begin
sw /kwhi /r2 /s /bred "SW.EXE - Enhance Your Batch Files!" /0 /w /m " v 4.2 " /o /z
sw /r10 /l1 /bcya /fRED "In it's simplest form, SW displays your text" "in a window in the center of the screen."
sw /r18 /l3 /t11 "Display up to 20 lines" /t14 "- each with its own color -" /t12 "in one window!" /0
sw /r25 /l0 /0 " - Press any key to continue - " /p100-
rem More command line examples, justify, borders
sw /kcya░ /r2 /s /bred "SW.EXE - Add Color to Your BAT's!" /tYEL "So easy to use!" /w /0 /m " v 4.2 " /z
sw /fbla /byel /l4 /r10 "Other parameters allow different window colors," "double spacing, and 5 different borders" /2
sw /b7 /r19 /g4 /l "Clear the screen with color" "using an optional character for texture" "& make windows with shadows." /0 /s
sw /bwhi /r19 /gyel /l0 /0 /c4 /jl " Justify " " Text" " Left"
sw /bwhi /r19 /gyel /l0 /0 /c66 /jr " Justify " "Text " "Right "
sw /r25 /l0 /0 " - Press any key to continue - " /p100-
set colr=bla
rem Make sure there was room in the environment
if "%colr=="" goto next
rem Another command line example, Query with default, Border Message, Draw
rem Draw a full screen window
sw /r125 /c180 /o1 " "
sw /r3 /s /bred "SW.EXE - Flow Control for BAT's!" /w /0 /m " v 4.2 " /z
rem The following line is longer than 128 characters BUT it works because
rem when the line is processed by DOS, the %colr% variable is replaced by
rem the color value making the command line 3 characters shorter.
:colors
sw /e12 /r13 /b%colr% /s /mc /t14 "▌ Pick a Color ▐" "~Brown ~Cyan ~White ~Green" "Press ~E~S~C to go on..." /q^~bcwg /2 /l5 /d
if errorlevel 4 set colr=gre
if errorlevel 4 goto colors
if errorlevel 3 set colr=whi
if errorlevel 3 goto colors
if errorlevel 2 set colr=cya
if errorlevel 2 goto colors
if errorlevel 1 set colr=yel
if errorlevel 1 goto colors
:next
set colr=
rem Display screen definition with default label
sw @sw42demo.bat
rem Display screen definition in external file
sw @sw-42.new
rem Display screen definition with label 'menu'
sw @sw42demo.bat Snd_menu
rem Query is handled separately beacause I wanted to return to the menu
rem after processing the response without redoing the screen.
rem I also placed it nearer the top of the file to speed it up.
goto beepdemo
rem create screen definition on the fly to demo DI.EXE
:DI
if exist di.hlp goto DI_Display
sw /r15 /l1 /0 /s /bwhi /fBLU /gblu "Standby!" "Building Next Screen"
echo rem This file was created by SW42DEMO.BAT > di.hlp
echo rem If simply viewing this file, Try the following command at the DOS prompt >> di.hlp
echo rem "SW @DI.HLP" >> di.hlp
echo.>> di.hlp
echo :Display >> di.hlp
echo _window /kmag▒─┼─▒ /s /bred /r2 /0 /w >> di.hlp
echo SW.EXE - Now with DI!>> di.hlp
echo /mc v 4.2 >> di.hlp
echo _window /jl /s /0 /r9 >> di.hlp
echo /mc Disk Information >> di.hlp
echo.>> di.hlp
di >> di.hlp
echo. >> di.hlp
echo _window /r25 /bblu /l0 /0 /p300- >> di.hlp
echo - Press any key to continue - >> di.hlp
echo :End_Display >> di.hlp
:DI_Display
sw @di.hlp
rem Display screen definition with label '4.2'
:final
sw @sw42demo.bat 4.2
rem display help screen
:help
sw